package com.zhang.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
//注册成组件，等价于 <bean id="user" class="com.com.zhang.pojo.User">

public class User {
    @Value("张波")
    private String name;

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                '}';
    }
}
